package com.hilaver.dzmis.product;

import java.math.BigDecimal;
import java.sql.Blob;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

import com.hilaver.dzmis.basicinfo.BiArmor;
import com.hilaver.dzmis.basicinfo.BiFactory;
import com.hilaver.dzmis.basicinfo.BiFranceCustomer;
import com.hilaver.dzmis.basicinfo.BiMeasureSpecification;
import com.hilaver.dzmis.basicinfo.BiReference;
import com.hilaver.dzmis.basicinfo.BiYarn;
import com.hilaver.dzmis.procurement.Procurement;
import com.hilaver.dzmis.procurement.ProductPackage;

/**
 * ProductIdentification generated by MyEclipse Persistence Tools
 */

public class ProductIdentification implements java.io.Serializable {

	// Fields

	private Integer id;
	
	private ProductWorkFlow productWorkFlow;
	
	private ProductPrice productPrice;

	private BiFactory biFactory;

	private BiFranceCustomer biFranceCustomer;
	
	private Procurement procurement;
	
	private ProductPackage productPackage;
	
	private String reference;
	
	private String referenceAs;
	
	private Integer similarId;
	
	private Integer referenceIndex;

	private String ctProductIdentificationStyle;
	
	private String ctStature;
	
	private String ctMachineType;
	
	private String ctCollarType;

	private String isSimilary;

	private String isNewfashioned;

	private String isDifficulty;

	private String dhlNumber;

	private String ctDesignType;

	private String style;

	private String customerLinkman;

	private String model;

	private String ctSeasonNumber;

	private BiReference biReference;

	private Date createDate;

	private String ctVersion;

	private String patronageNumer;

	private BiArmor front;

	private BiArmor back;

	private BiArmor sleeves;

	private BiArmor bottomThrum;

	private BiArmor sleevesThrum;

	private BiArmor necklineThrum;
	
	private Integer needle;
	
	private Double weight;
	
	private String equipment;
	
	private String jauge;

	private String comment;

	private Integer biChartRepositoryId;

	private Blob sketch1;

	private String sketch1Name;
	
	private Boolean isSketch1Deleted;
	
	private String sketch1DescriptionFR;
	private String sketch1DescriptionCN;
	private String sketch1DescriptionEN;
	
	private Blob sketch2;

	private String sketch2Name;
	
	private Boolean isSketch2Deleted;
	
	private String sketch2DescriptionFR;
	private String sketch2DescriptionCN;
	private String sketch2DescriptionEN;

	private BiMeasureSpecification biMeasureSpecification;
	
	private Integer creatorId;

	private Integer modiferId;

	private Integer ownerId;

	private Date modifyDate;

	private Double unitPrice;
	
	private String tagComment;
	
	private Blob sketch3;
	
	private String sketch3Name;
	
	private Boolean isSketch3Deleted;
	
	private String sketch3DescriptionFR;
	private String sketch3DescriptionCN;
	private String sketch3DescriptionEN;
	
	private Blob sketch4;

	private String sketch4Name;
	
	private Boolean isSketch4Deleted;
	
	private Float densityColumms1;
	private Float densityRows1;
	
	private Float densityColumms2;
	private Float densityRows2;
	
	private Float densityColumms3;
	private Float densityRows3;
	
	private Float densityColumms4;
	private Float densityRows4;
	
	private Float densityColumms5;
	private Float densityRows5;
	
	private Float densityColumms6;
	private Float densityRows6;
	
	private Date confirmedDate;
	
	private Double yarnSize1;
	
	private Double yarnSize2;
	
	private Double yarnSize3;
	
	private Double yarnSize4;
	
	private Double yarnSize5;
	
	private Double yarnSize6;
	
	private Double yarnSize7;
	
	private Double yarnSize8;
	
	private Double coefficient;
	
	private String isConfirmed;
	
	private String isInprocess1;
	
	private String isInprocess2;
	
	private Set productMeasureSpecificationItems = new TreeSet(new Foo());

	private Set productOrderItems = new TreeSet(new Foo());
	
	private Set productOrderWls = new TreeSet(new Foo());

	private Set productYarns = new TreeSet(new Foo());

	private Set productPrices = new HashSet(0);

	private Set productAccessoryOtherses = new TreeSet(new Foo());

	private Set productAccessoryHangs = new TreeSet(new Foo());
	
	private Set productRowses = new TreeSet(new Foo());

	private Set productAccessoryZips = new TreeSet(new Foo());
	
	private Set productAccessoryButtons = new TreeSet(new Foo());

	private Set productChartCommentses = new TreeSet(new Foo());
	
	private Set productDZColors = new TreeSet(new Foo());
	
	private Set productLaunchings = new TreeSet(new Foo());
	
	private Set orderProducts = new TreeSet(new Foo());

	class Foo implements Comparator {
		public int compare(Object s1, Object s2) {
			return 1;
		}
	}
	// Constructors

	/** default constructor */
	public ProductIdentification() {
	}

	// Property accessors

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public BiFactory getBiFactory() {
		return this.biFactory;
	}

	public void setBiFactory(BiFactory biFactory) {
		this.biFactory = biFactory;
	}

	public ProductPrice getProductPrice() {
		return productPrice;
	}

	public void setProductPrice(ProductPrice productPrice) {
		this.productPrice = productPrice;
	}

	public BiFranceCustomer getBiFranceCustomer() {
		return this.biFranceCustomer;
	}

	public void setBiFranceCustomer(BiFranceCustomer biFranceCustomer) {
		this.biFranceCustomer = biFranceCustomer;
	}

	public String getReference() {
		return reference;
	}

	public void setReference(String reference) {
		this.reference = reference;
	}

	public Integer getReferenceIndex() {
		return referenceIndex;
	}

	public void setReferenceIndex(Integer referenceIndex) {
		this.referenceIndex = referenceIndex;
	}

	public String getCtProductIdentificationStyle() {
		return ctProductIdentificationStyle;
	}

	public void setCtProductIdentificationStyle(String ctProductIdentificationStyle) {
		this.ctProductIdentificationStyle = ctProductIdentificationStyle;
	}

	public String getIsSimilary() {
		return this.isSimilary;
	}

	public void setIsSimilary(String isSimilary) {
		this.isSimilary = isSimilary;
	}

	public String getIsNewfashioned() {
		return this.isNewfashioned;
	}

	public void setIsNewfashioned(String isNewfashioned) {
		this.isNewfashioned = isNewfashioned;
	}

	public String getIsDifficulty() {
		return this.isDifficulty;
	}

	public void setIsDifficulty(String isDifficulty) {
		this.isDifficulty = isDifficulty;
	}

	public String getDhlNumber() {
		return this.dhlNumber;
	}

	public void setDhlNumber(String dhlNumber) {
		this.dhlNumber = dhlNumber;
	}

	public String getCtDesignType() {
		return this.ctDesignType;
	}

	public void setCtDesignType(String ctDesignType) {
		this.ctDesignType = ctDesignType;
	}

	public String getStyle() {
		return this.style;
	}

	public void setStyle(String style) {
		this.style = style;
	}

	public String getCustomerLinkman() {
		return this.customerLinkman;
	}

	public void setCustomerLinkman(String customerLinkman) {
		this.customerLinkman = customerLinkman;
	}

	public String getModel() {
		return this.model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public BiReference getBiReference() {
		return biReference;
	}

	public void setBiReference(BiReference biReference) {
		this.biReference = biReference;
	}

	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getCtSeasonNumber() {
		return ctSeasonNumber;
	}

	public void setCtSeasonNumber(String ctSeasonNumber) {
		this.ctSeasonNumber = ctSeasonNumber;
	}

	public String getCtVersion() {
		return ctVersion;
	}

	public void setCtVersion(String ctVersion) {
		this.ctVersion = ctVersion;
	}

	public String getPatronageNumer() {
		return this.patronageNumer;
	}

	public void setPatronageNumer(String patronageNumer) {
		this.patronageNumer = patronageNumer;
	}

	public String getCtStature() {
		return ctStature;
	}

	public void setCtStature(String ctStature) {
		this.ctStature = ctStature;
	}

	public BiArmor getFront() {
		return front;
	}

	public void setFront(BiArmor front) {
		this.front = front;
	}

	public BiArmor getBack() {
		return back;
	}

	public void setBack(BiArmor back) {
		this.back = back;
	}

	public BiArmor getSleeves() {
		return sleeves;
	}

	public void setSleeves(BiArmor sleeves) {
		this.sleeves = sleeves;
	}

	public BiArmor getBottomThrum() {
		return bottomThrum;
	}

	public String getReferenceAs() {
		return referenceAs;
	}

	public void setReferenceAs(String referenceAs) {
		this.referenceAs = referenceAs;
	}

	public Integer getSimilarId() {
		return similarId;
	}

	public void setSimilarId(Integer similarId) {
		this.similarId = similarId;
	}

	public void setBottomThrum(BiArmor bottomThrum) {
		this.bottomThrum = bottomThrum;
	}

	public BiArmor getSleevesThrum() {
		return sleevesThrum;
	}

	public void setSleevesThrum(BiArmor sleevesThrum) {
		this.sleevesThrum = sleevesThrum;
	}

	public BiArmor getNecklineThrum() {
		return necklineThrum;
	}

	public void setNecklineThrum(BiArmor necklineThrum) {
		this.necklineThrum = necklineThrum;
	}

	public String getComment() {
		return this.comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public Integer getBiChartRepositoryId() {
		return this.biChartRepositoryId;
	}

	public void setBiChartRepositoryId(Integer biChartRepositoryId) {
		this.biChartRepositoryId = biChartRepositoryId;
	}

	public BiMeasureSpecification getBiMeasureSpecification() {
		return this.biMeasureSpecification;
	}

	public void setBiMeasureSpecification(BiMeasureSpecification biMeasureSpecification) {
		this.biMeasureSpecification = biMeasureSpecification;
	}

	public Integer getCreatorId() {
		return this.creatorId;
	}

	public void setCreatorId(Integer creatorId) {
		this.creatorId = creatorId;
	}

	public Integer getModiferId() {
		return this.modiferId;
	}

	public void setModiferId(Integer modiferId) {
		this.modiferId = modiferId;
	}

	public Integer getOwnerId() {
		return this.ownerId;
	}

	public void setOwnerId(Integer ownerId) {
		this.ownerId = ownerId;
	}

	public Date getModifyDate() {
		return this.modifyDate;
	}

	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}

	public Set getProductOrderItems() {
		return this.productOrderItems;
	}

	public void setProductOrderItems(Set productOrderItems) {
		this.productOrderItems = productOrderItems;
	}

	public Set getProductYarns() {
		return this.productYarns;
	}

	public void setProductYarns(Set productYarns) {
		this.productYarns = productYarns;
	}

	public Set getProductPrices() {
		return this.productPrices;
	}

	public void setProductPrices(Set productPrices) {
		this.productPrices = productPrices;
	}

	public Set getProductAccessoryOtherses() {
		return this.productAccessoryOtherses;
	}

	public void setProductAccessoryOtherses(Set productAccessoryOtherses) {
		this.productAccessoryOtherses = productAccessoryOtherses;
	}

	public Set getProductRowses() {
		return this.productRowses;
	}

	public void setProductRowses(Set productRowses) {
		this.productRowses = productRowses;
	}

	public Set getProductAccessoryZips() {
		return this.productAccessoryZips;
	}

	public void setProductAccessoryZips(Set productAccessoryZips) {
		this.productAccessoryZips = productAccessoryZips;
	}

	public Set getProductChartCommentses() {
		return this.productChartCommentses;
	}

	public void setProductChartCommentses(Set productChartCommentses) {
		this.productChartCommentses = productChartCommentses;
	}

	public Integer getNeedle() {
		return needle;
	}

	public void setNeedle(Integer needle) {
		this.needle = needle;
	}

	public Double getWeight() {
		if(weight != null){
			return (new BigDecimal(this.weight)).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
		}
		return weight;
	}

	public void setWeight(Double weight) {
		this.weight = weight;
	}


	public String getCtMachineType() {
		return ctMachineType;
	}

	public void setCtMachineType(String ctMachineType) {
		this.ctMachineType = ctMachineType;
	}

	public ProductWorkFlow getProductWorkFlow() {
		return productWorkFlow;
	}

	public void setProductWorkFlow(ProductWorkFlow productWorkFlow) {
		this.productWorkFlow = productWorkFlow;
	}

	public Procurement getProcurement() {
		return procurement;
	}

	public void setProcurement(Procurement procurement) {
		this.procurement = procurement;
	}

	public String getCtCollarType() {
		return ctCollarType;
	}

	public void setCtCollarType(String ctCollarType) {
		this.ctCollarType = ctCollarType;
	}

	public ProductPackage getProductPackage() {
		return productPackage;
	}

	public void setProductPackage(ProductPackage productPackage) {
		this.productPackage = productPackage;
	}
	
	public Double getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(Double unitPrice) {
		this.unitPrice = unitPrice;
	}

	public String getTagComment() {
		return tagComment;
	}

	public void setTagComment(String tagComment) {
		this.tagComment = tagComment;
	}

	public Set getProductMeasureSpecificationItems() {
		return productMeasureSpecificationItems;
	}

	public void setProductMeasureSpecificationItems(
			Set productMeasureSpecificationItems) {
		this.productMeasureSpecificationItems = productMeasureSpecificationItems;
	}

	public Set getProductOrderWls() {
		return productOrderWls;
	}

	public void setProductOrderWls(Set productOrderWls) {
		this.productOrderWls = productOrderWls;
	}

	public String getEquipment() {
		return equipment;
	}

	public void setEquipment(String equipment) {
		this.equipment = equipment;
	}

	public String getJauge() {
		return jauge;
	}

	public void setJauge(String jauge) {
		this.jauge = jauge;
	}

	public Set getProductDZColors() {
		return productDZColors;
	}

	public void setProductDZColors(Set productDZColors) {
		this.productDZColors = productDZColors;
	}

	public Set getProductAccessoryButtons() {
		return productAccessoryButtons;
	}

	public void setProductAccessoryButtons(Set productAccessoryButtons) {
		this.productAccessoryButtons = productAccessoryButtons;
	}

	public Blob getSketch1() {
		return sketch1;
	}

	public void setSketch1(Blob sketch1) {
		this.sketch1 = sketch1;
	}

	public String getSketch1Name() {
		return sketch1Name;
	}

	public void setSketch1Name(String sketch1Name) {
		this.sketch1Name = sketch1Name;
	}

	public Blob getSketch2() {
		return sketch2;
	}

	public void setSketch2(Blob sketch2) {
		this.sketch2 = sketch2;
	}

	public String getSketch2Name() {
		return sketch2Name;
	}

	public void setSketch2Name(String sketch2Name) {
		this.sketch2Name = sketch2Name;
	}

	public Blob getSketch3() {
		return sketch3;
	}

	public void setSketch3(Blob sketch3) {
		this.sketch3 = sketch3;
	}

	public String getSketch3Name() {
		return sketch3Name;
	}

	public void setSketch3Name(String sketch3Name) {
		this.sketch3Name = sketch3Name;
	}

	public Blob getSketch4() {
		return sketch4;
	}

	public void setSketch4(Blob sketch4) {
		this.sketch4 = sketch4;
	}

	public String getSketch4Name() {
		return sketch4Name;
	}

	public void setSketch4Name(String sketch4Name) {
		this.sketch4Name = sketch4Name;
	}

	public Boolean getIsSketch4Deleted() {
		return isSketch4Deleted;
	}

	public void setIsSketch4Deleted(Boolean isSketch4Deleted) {
		this.isSketch4Deleted = isSketch4Deleted;
	}

	public Set getProductLaunchings() {
		return productLaunchings;
	}

	public void setProductLaunchings(Set productLaunchings) {
		this.productLaunchings = productLaunchings;
	}

	public Double getYarnSize1() {
		return yarnSize1;
	}

	public void setYarnSize1(Double yarnSize1) {
		this.yarnSize1 = yarnSize1;
	}

	public Double getYarnSize2() {
		return yarnSize2;
	}

	public void setYarnSize2(Double yarnSize2) {
		this.yarnSize2 = yarnSize2;
	}

	public Double getYarnSize3() {
		return yarnSize3;
	}

	public void setYarnSize3(Double yarnSize3) {
		this.yarnSize3 = yarnSize3;
	}

	public Double getYarnSize4() {
		return yarnSize4;
	}

	public void setYarnSize4(Double yarnSize4) {
		this.yarnSize4 = yarnSize4;
	}

	public Double getYarnSize5() {
		return yarnSize5;
	}

	public void setYarnSize5(Double yarnSize5) {
		this.yarnSize5 = yarnSize5;
	}

	public Double getYarnSize6() {
		return yarnSize6;
	}

	public void setYarnSize6(Double yarnSize6) {
		this.yarnSize6 = yarnSize6;
	}

	public Double getYarnSize7() {
		return yarnSize7;
	}

	public void setYarnSize7(Double yarnSize7) {
		this.yarnSize7 = yarnSize7;
	}

	public Double getYarnSize8() {
		return yarnSize8;
	}

	public void setYarnSize8(Double yarnSize8) {
		this.yarnSize8 = yarnSize8;
	}

	public Double getCoefficient() {
		return coefficient;
	}

	public void setCoefficient(Double coefficient) {
		this.coefficient = coefficient;
	}

	public String getIsConfirmed() {
		return isConfirmed;
	}

	public void setIsConfirmed(String isConfirmed) {
		this.isConfirmed = isConfirmed;
	}

	public String getSketch1DescriptionFR() {
		return sketch1DescriptionFR;
	}

	public void setSketch1DescriptionFR(String sketch1DescriptionFR) {
		this.sketch1DescriptionFR = sketch1DescriptionFR;
	}

	public String getSketch1DescriptionCN() {
		return sketch1DescriptionCN;
	}

	public void setSketch1DescriptionCN(String sketch1DescriptionCN) {
		this.sketch1DescriptionCN = sketch1DescriptionCN;
	}

	public String getSketch1DescriptionEN() {
		return sketch1DescriptionEN;
	}

	public void setSketch1DescriptionEN(String sketch1DescriptionEN) {
		this.sketch1DescriptionEN = sketch1DescriptionEN;
	}

	public String getSketch2DescriptionFR() {
		return sketch2DescriptionFR;
	}

	public void setSketch2DescriptionFR(String sketch2DescriptionFR) {
		this.sketch2DescriptionFR = sketch2DescriptionFR;
	}

	public String getSketch2DescriptionCN() {
		return sketch2DescriptionCN;
	}

	public void setSketch2DescriptionCN(String sketch2DescriptionCN) {
		this.sketch2DescriptionCN = sketch2DescriptionCN;
	}

	public String getSketch2DescriptionEN() {
		return sketch2DescriptionEN;
	}

	public void setSketch2DescriptionEN(String sketch2DescriptionEN) {
		this.sketch2DescriptionEN = sketch2DescriptionEN;
	}

	public String getSketch3DescriptionFR() {
		return sketch3DescriptionFR;
	}

	public void setSketch3DescriptionFR(String sketch3DescriptionFR) {
		this.sketch3DescriptionFR = sketch3DescriptionFR;
	}

	public String getSketch3DescriptionCN() {
		return sketch3DescriptionCN;
	}

	public void setSketch3DescriptionCN(String sketch3DescriptionCN) {
		this.sketch3DescriptionCN = sketch3DescriptionCN;
	}

	public String getSketch3DescriptionEN() {
		return sketch3DescriptionEN;
	}

	public void setSketch3DescriptionEN(String sketch3DescriptionEN) {
		this.sketch3DescriptionEN = sketch3DescriptionEN;
	}

	public Boolean getIsSketch1Deleted() {
		return isSketch1Deleted;
	}

	public void setIsSketch1Deleted(Boolean isSketch1Deleted) {
		this.isSketch1Deleted = isSketch1Deleted;
	}

	public Boolean getIsSketch2Deleted() {
		return isSketch2Deleted;
	}

	public void setIsSketch2Deleted(Boolean isSketch2Deleted) {
		this.isSketch2Deleted = isSketch2Deleted;
	}

	public Boolean getIsSketch3Deleted() {
		return isSketch3Deleted;
	}

	public void setIsSketch3Deleted(Boolean isSketch3Deleted) {
		this.isSketch3Deleted = isSketch3Deleted;
	}

	public Date getConfirmedDate() {
		return confirmedDate;
	}

	public void setConfirmedDate(Date confirmedDate) {
		this.confirmedDate = confirmedDate;
	}

	public Set getProductAccessoryHangs() {
		return productAccessoryHangs;
	}

	public void setProductAccessoryHangs(Set productAccessoryHangs) {
		this.productAccessoryHangs = productAccessoryHangs;
	}

	public Set getOrderProducts() {
		return orderProducts;
	}

	public void setOrderProducts(Set orderProducts) {
		this.orderProducts = orderProducts;
	}

	public Float getDensityColumms1() {
		return densityColumms1;
	}

	public void setDensityColumms1(Float densityColumms1) {
		this.densityColumms1 = densityColumms1;
	}

	public Float getDensityRows1() {
		return densityRows1;
	}

	public void setDensityRows1(Float densityRows1) {
		this.densityRows1 = densityRows1;
	}

	public Float getDensityColumms2() {
		return densityColumms2;
	}

	public void setDensityColumms2(Float densityColumms2) {
		this.densityColumms2 = densityColumms2;
	}

	public Float getDensityRows2() {
		return densityRows2;
	}

	public void setDensityRows2(Float densityRows2) {
		this.densityRows2 = densityRows2;
	}

	public Float getDensityColumms3() {
		return densityColumms3;
	}

	public void setDensityColumms3(Float densityColumms3) {
		this.densityColumms3 = densityColumms3;
	}

	public Float getDensityRows3() {
		return densityRows3;
	}

	public void setDensityRows3(Float densityRows3) {
		this.densityRows3 = densityRows3;
	}

	public Float getDensityColumms4() {
		return densityColumms4;
	}

	public void setDensityColumms4(Float densityColumms4) {
		this.densityColumms4 = densityColumms4;
	}

	public Float getDensityRows4() {
		return densityRows4;
	}

	public void setDensityRows4(Float densityRows4) {
		this.densityRows4 = densityRows4;
	}

	public Float getDensityColumms5() {
		return densityColumms5;
	}

	public void setDensityColumms5(Float densityColumms5) {
		this.densityColumms5 = densityColumms5;
	}

	public Float getDensityRows5() {
		return densityRows5;
	}

	public void setDensityRows5(Float densityRows5) {
		this.densityRows5 = densityRows5;
	}

	public Float getDensityColumms6() {
		return densityColumms6;
	}

	public void setDensityColumms6(Float densityColumms6) {
		this.densityColumms6 = densityColumms6;
	}

	public Float getDensityRows6() {
		return densityRows6;
	}

	public void setDensityRows6(Float densityRows6) {
		this.densityRows6 = densityRows6;
	}
	
	public String getIsInprocess1() {
		return isInprocess1;
	}

	public void setIsInprocess1(String isInprocess1) {
		this.isInprocess1 = isInprocess1;
	}

	public String getIsInprocess2() {
		return isInprocess2;
	}

	public void setIsInprocess2(String isInprocess2) {
		this.isInprocess2 = isInprocess2;
	}

	public List<ProductDZColor> getDiffProductDZColor(){
		List<ProductDZColor> productDZColorList = new ArrayList<ProductDZColor>();
		Set<ProductDZColor> pCZColorSet = productDZColors;
		String variant = "";
		int colorIndex = 1;
		for (ProductDZColor pDZColor : pCZColorSet) {
			if (colorIndex == 1) {
				variant = pDZColor.getVariant();
			}
			if (variant.equals(pDZColor.getVariant())) {
				productDZColorList.add(pDZColor);
			}
			colorIndex++;
		}
		return productDZColorList;
	}

	public boolean equals(Object obj) {
		if (!(obj instanceof ProductIdentification)) {
			return false;
		}
		ProductIdentification pi = (ProductIdentification)obj;
		if(pi.getId().equals(this.getId())){
			return true;
		}
		return false;
	}

	@Override
	public String toString() {
		return this.reference;
	}

}